# workcap_bottom.mod
#
param cl{EDGES} default 1;

var Pb {FLOWSL, EDGES} binary default 0;
var wl {EDGES} default 0;

# min c^t w
minimize wl_cost:  (sum {(i1,i2) in EDGES} cl[i1,i2]*wl[i1,i2])/2 ;

# P B^T = D
s.t. mass_baW_b {(r1,r2) in FLOWSL, n1 in VERTS}:
  sum {(i1,i2) in EDGES} Pb[r1,r2,i1,i2]*BL[n1,i1,i2] 
      = DL[r1,r2,n1];

s.t. cap_aggrW_b {(i1,i2) in EDGES}:
  wl[i1,i2] = sum{(r1,r2) in FLOWSL} Pb[r1,r2,i1,i2]*ML[r1,r2];

s.t. work_sym_b {(r1,r2) in FLOWSL, (i1,i2) in EDGES}:
  Pb[r1,r2,i1,i2] = Pb[r2,r1,i2,i1];
# P is symatric for symetric flows

problem find_work_b:  wl_cost,  mass_baW_b, cap_aggrW_b, work_sym_b, Pb, wl;


